package com.zhengxing.jienci.stream.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.messaging.support.MessageBuilder;
import javax.annotation.Resource;
import java.util.UUID;

/**
 * @author 浪遏飞舟
 * @create 2020-09-23 14:37
 */
@EnableBinding(Source1.class)
public class IMessageProviderImpl2 {

    @Autowired
    private Source1 output2;

    /**
     * 发送消息
     * @return
    */
    public String send() {
        String uuid = UUID.randomUUID().toString();
        output2.output1().send(MessageBuilder.withPayload(uuid).build());
        System.out.println("output1通道发送消息:" + uuid);
        return null;
    }
}
